#!/bin/bash

BUILD_DIR=build

# 编译NETEQ SO
if [ -e ${BUILD_DIR} ]; then
  rm -r ${BUILD_DIR}
fi

mkdir ${BUILD_DIR}
cd ${BUILD_DIR}
cmake ..
make -j8

# 编译OPUS SO
cd ../third_party/opus
if [ -e ${BUILD_DIR} ]; then
  rm -r ${BUILD_DIR}
fi

mkdir ${BUILD_DIR}
cd ${BUILD_DIR}
cmake ..
make -j8

# 编译测试程序
cd ../../../test
if [ -e ${BUILD_DIR} ]; then
  rm -r ${BUILD_DIR}
fi

mkdir ${BUILD_DIR}
cd ${BUILD_DIR}
cmake ..
make -j8

